/* ============================================================
   Auth Page — بوصلة (Bawsala)
   Restyled to match the dark green + gold luxury identity
   ============================================================ */

:root {
    --bg:       #003329;
    --bg-2:     #012a22;
    --bg-3:     #011f19;
    --accent:   #d9c994;
    --accent-2: #eee1b8;
    --on-accent:#0b241d;
    --light:    rgba(255, 255, 255, 0.05);
    --muted:    rgba(243, 239, 228, 0.62);
    --danger:   #ff6b6b;
    --warn:     #f3b93a;
    --ok:       #4ade80;
    --text:     #ffffff;
    --sub:      var(--muted);
    --border:   rgba(255, 255, 255, 0.14);
    --white:    #ffffff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

[dir="rtl"] body {
    font-family: "IBM Plex Sans Arabic", "Segoe UI", Arial, sans-serif;
}


.auth-page {
    display: grid;
    grid-template-columns: 420px 1fr;
    min-height: calc(100vh - 64px);
    margin-top: 64px;
}


.auth-left {
    background:
        radial-gradient(480px 480px at 15% 15%, rgba(217, 201, 148, 0.16), transparent 70%),
        linear-gradient(150deg, var(--bg-3) 0%, var(--bg) 60%, #024537 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    border-right: 1px solid var(--border);
}

[dir="rtl"] .auth-left { border-right: none; border-left: 1px solid var(--border); }

.auth-left-inner {
    position: relative;
    z-index: 2;
    color: #fff;
}

.al-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 40px;
    letter-spacing: 0.5px;
}

.al-logo i {
    font-size: 28px;
    color: var(--accent);
}

.al-headline {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: #fff;
}

.al-sub {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 36px;
}

.al-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.al-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.al-features li i {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(217, 201, 148, 0.14);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
}

.al-blob {
    position: absolute;
    border-radius: 50%;
    opacity: 0.10;
    pointer-events: none;
}
.al-blob1 {
    width: 320px; height: 320px;
    background: var(--accent);
    top: -80px; right: -100px;
}
.al-blob2 {
    width: 220px; height: 220px;
    background: var(--accent-2);
    bottom: -60px; left: -60px;
}


.auth-right {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    background: var(--bg);
    overflow-y: auto;
}

.auth-box {
    width: 100%;
    max-width: 440px;
}


.auth-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 28px;
    gap: 4px;
}

.atab {
    flex: 1;
    padding: 11px 0;
    border: none;
    border-radius: 9px;
    background: transparent;
    font-size: 14px;
    font-weight: 700;
    font-family: inherit;
    color: var(--sub);
    cursor: pointer;
    transition: all 0.25s ease;
}

.atab.active {
    background: var(--accent);
    color: var(--on-accent);
    box-shadow: 0 4px 16px rgba(217, 201, 148, 0.28);
}

.atab:hover:not(.active) { color: var(--white); }


.auth-toast {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 11px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 18px;
    animation: toastIn 0.3s ease;
}

.auth-toast.error {
    display: flex;
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.35);
    color: var(--danger);
}

.auth-toast.success {
    display: flex;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid rgba(74, 222, 128, 0.35);
    color: var(--ok);
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}


.auth-panel {
    display: none;
    flex-direction: column;
    gap: 0;
    animation: panelIn 0.3s ease;
}

.auth-panel.active { display: flex; }

@keyframes panelIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}


.panel-head {
    text-align: center;
    margin-bottom: 26px;
}

.panel-head h3 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

.panel-head p {
    font-size: 13px;
    color: var(--sub);
    line-height: 1.5;
}

.panel-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(217, 201, 148, 0.12);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    margin: 0 auto 14px;
}

.panel-icon.sent { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
.panel-icon.ok   { background: rgba(74, 222, 128, 0.12); color: var(--ok); }


.field-wrap {
    position: relative;
    margin-bottom: 16px;
}

.field-wrap .fi {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

[dir="rtl"] .field-wrap .fi { left: auto; right: 14px; }

.field-wrap input {
    width: 100%;
    padding: 16px 42px 6px 42px;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-family: inherit;
    background: var(--light);
    color: var(--text);
    outline: none;
    transition: border-color 0.22s, box-shadow 0.22s, background 0.22s;
    appearance: none;
    color-scheme: dark;
}

[dir="rtl"] .field-wrap input { padding: 16px 42px 6px 42px; }

.field-wrap input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(217, 201, 148, 0.14);
}

.field-wrap input:focus ~ .fi { color: var(--accent); }

.field-wrap input:focus ~ label,
.field-wrap input:not(:placeholder-shown) ~ label {
    top: 7px;
    font-size: 10px;
    color: var(--accent);
}

.field-wrap label {
    position: absolute;
    left: 42px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: var(--sub);
    pointer-events: none;
    transition: all 0.2s ease;
}

[dir="rtl"] .field-wrap label { left: auto; right: 42px; }

.eye-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s;
}

.eye-btn:hover { color: var(--accent); }
[dir="rtl"] .eye-btn { right: auto; left: 12px; }

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}


.strength-wrap {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: -10px 0 8px;
    overflow: hidden;
}

.strength-bar {
    height: 100%;
    border-radius: 4px;
    width: 0;
    transition: width 0.4s ease, background 0.4s ease;
}

.strength-label {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 10px;
    min-height: 16px;
    letter-spacing: 0.3px;
}


.form-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    font-size: 13px;
}

.remember-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--sub);
    cursor: pointer;
}

.remember-wrap input { width: 15px; height: 15px; accent-color: var(--accent); }

.terms-agree {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 18px;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--sub);
    cursor: pointer;
}

.terms-agree input {
    width: 15px;
    height: 15px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.terms-agree a {
    color: var(--accent);
    text-decoration: underline;
}


.btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--accent-2) 0%, var(--accent) 100%);
    color: var(--on-accent);
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 24px rgba(217, 201, 148, 0.25);
    margin-bottom: 16px;
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
    box-shadow: 0 12px 32px rgba(217, 201, 148, 0.38);
}

.btn-primary:active { transform: translateY(0); }

.btn-primary.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-outline {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 20px;
    background: transparent;
    color: var(--sub);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.22s;
}

.btn-outline:hover {
    border-color: rgba(255, 107, 107, 0.5);
    color: var(--danger);
    background: rgba(255, 107, 107, 0.08);
}

.text-link {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.text-link:hover { color: var(--accent-2); text-decoration: underline; }


.switch-text {
    text-align: center;
    font-size: 13px;
    color: var(--sub);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}


.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: none;
    border: none;
    color: var(--sub);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    padding: 0;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.back-btn:hover { color: var(--accent); }


.otp-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
}

.otp-box {
    width: 50px;
    height: 58px;
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    background: rgba(255, 255, 255, 0.04);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s, background 0.2s;
    caret-color: var(--accent);
    color-scheme: dark;
}

.otp-box:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(217, 201, 148, 0.18);
    transform: scale(1.06);
    background: rgba(255, 255, 255, 0.07);
}

.otp-box.filled {
    border-color: var(--ok);
    background: rgba(74, 222, 128, 0.08);
}

.otp-sep {
    font-size: 20px;
    color: var(--muted);
    margin: 0 4px;
    font-weight: 300;
}


.resend-wrap {
    text-align: center;
    font-size: 13px;
    color: var(--sub);
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#resendTimer {
    font-size: 12px;
    color: var(--muted);
}


.account-avatar {
    text-align: center;
    font-size: 64px;
    color: var(--accent);
    margin-bottom: 10px;
    opacity: 0.9;
}

#panelAccount .panel-head h3 {
    font-size: 20px;
}

#panelAccount .btn-primary {
    margin-top: 8px;
    margin-bottom: 12px;
}


@media (max-width: 860px) {
    .auth-page {
        grid-template-columns: 1fr;
    }
    .auth-left { display: none; }
    .auth-right {
        min-height: calc(100vh - 64px);
    }
}

@media (max-width: 480px) {
    .auth-box { max-width: 100%; }
    .field-row { grid-template-columns: 1fr; }
    .otp-box   { width: 42px; height: 50px; font-size: 18px; }
}
